<template>
  <div class="j-airag-vue-node-content">
    <div class="jeecg-airag-base-node-container" :class="{ isHovered: isHovered, isSelected: isSelected }">
      <div class="header">
        <div class="icon" title="start-node">
          <div class="jeecg-airag-base-node-icon">
            <img src="@/assets/svg/question-node.svg" alt="" />
          </div>
        </div>
        <div class="text airag-node-label"><span>分类器</span></div>
        <div class="extra"><!----></div>
      </div>
      <div class="content">
        <div class="classifier-node-content">
         
         <div   v-for="(item,index) in properties?.options.categories" class="case-item">
            <div class="case-header">
              <div>分类{{ index+1 }}</div>
            </div>
            <div class="case-category">
              <div>{{ item.category || '-' }}</div>
            </div>
          </div>

          <div class="case-item">
            <div class="case-header">
              <div>ELSE</div>
            </div>
            <div class="case-category">
              <div>无分类</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, onMounted, reactive, watch } from 'vue';

const props = defineProps({
  model: {
    type: Object,
    default: () => ({})
  },
  properties: {
    type: Object,
    default: null
  },
  isHovered: {
    type: Boolean,
    default: false
  },
  isSelected: {
    type: Boolean,
    default: false
  }
});

</script>
<style  lang='less' scoped>
.j-airag-vue-node-content {
  display: flex;
  flex-direction: row;
  align-items: center;
}
.jeecg-airag-base-node-container:where(.selected) {
  border-color: #1890ff;
  width: 200px;
}
.jeecg-airag-base-node-container {
  width: 100%;
  height: 100%;
  position: relative;
  padding: 14px 16px;
  border-radius: 8px;
  background-color: #fff;
  border: 1px solid #eae7e7;
  box-shadow: 0 2px 4px #d6d6d6;
  transition: box-shadow 0.15s;
}
.jeecg-airag-base-node-container .header {
  display: flex;
  height: 30px;
  align-items: center;
  justify-content: start;
}
.jeecg-airag-base-node-container .header .icon {
  width: 30px;
}
.jeecg-airag-base-node-container .header .text {
  flex: 1;
}
.airag-node-label {
  color: rgb(51, 51, 51);
  font-size: 16px;
  font-weight: 700;
  font-family: 思源黑体, serif !important;
}
.jeecg-airag-base-node-container .header .extra {
  width: 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
}
.jeecg-airag-base-node-container .content,
.jeecg-airag-base-node-container .run-status {
  margin-top: 8px;
}
.jeecg-airag-base-node-icon {
  width: 25px;
  height: 25px;
  line-height: 25px;
  text-align: center;
  border-radius: 6px;
}
.jeecg-airag-base-node-container .add-node-dialog {
  width: 100;
  height: 100;
  background-color: #fff;
  border: 1px solid transparent;
  border-radius: 4px;
  box-shadow: 0 2px 4px #ced0d5;
  opacity: 0;
  transform: scale(0.05);
  pointer-events: none;
  transition: box-shadow 0.15s, opacity 0.3s, right 0.3s, transform 0.3s;
  position: absolute;
  top: 0;
  right: 0;
}
.jeecg-airag-base-node-container.isHovered {
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid #2475fc;
  }
}
.jeecg-airag-base-node-container.isSelected {
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 2px solid #2475fc;
  }
}

.jeecg-airag-base-node-container .classifier-node-content .case-item {
  text-align: right;
  color: #333;
}

.jeecg-airag-base-node-container .classifier-node-content .case-item:last-child {
  margin-bottom: 0;
}

.jeecg-airag-base-node-container .classifier-node-content .case-item .case-header {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.jeecg-airag-base-node-container .classifier-node-content .case-item .case-header > div {
  flex: 1;
  font-weight: 700;
  color: #333;
  text-align: right;
}

.jeecg-airag-base-node-container .classifier-node-content .case-item .case-category {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.jeecg-airag-base-node-container .classifier-node-content .case-item .case-category > div {
  flex: 1;
  color: #999;
  text-align: right;
}

.app-iconify {
  display: inline-block;
}
.anticon {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-style: normal;
  line-height: 0;
  text-align: center;
  text-transform: none;
  vertical-align: -0.125em;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
.j-airag-vue-node-anchor {
  position: relative;
  z-index: 0;
  width: 100%;
  color: #1890ff;
  height: 100%;
  border-radius: 50%;
  background-color: #fff;
  cursor: pointer;
}

.j-airag-vue-node-anchor svg {
  display: none;
}

.j-airag-vue-node-anchor svg:last-child {
  position: absolute;
  top: 0;
  left: 0;
}

.j-airag-vue-node-anchor.left {
  cursor: default;
}

.j-airag-vue-node-anchor.left:not(.has-edge) {
  color: #909090;
}

.j-airag-vue-node-anchor.left svg:first-child {
  display: initial;
}

.j-airag-vue-node-anchor.right svg:last-child {
  display: initial;
}

.j-airag-vue-node-anchor.right.has-edge svg {
  display: initial;
  opacity: 0;
  transition: opacity 0.3s;
}

.j-airag-vue-node-anchor.right.has-edge svg:first-child {
  opacity: 1;
}

.j-airag-vue-node-anchor.right.has-edge:hover svg {
  opacity: 0;
}

.j-airag-vue-node-anchor.right.has-edge:hover svg:last-child {
  opacity: 1 !important;
}

.j-airag-vue-node-edge-action {
  display: none;
  color: #1890ff;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background-color: #fff;
  transform: rotate(45deg);
}

.j-airag-vue-node-edge-action.hover {
  display: block;
}

.j-airag-vue-node-edge-action .app-iconify {
  cursor: pointer;
}

.j-airag-vue-node-edge-action .app-iconify svg {
  stroke-width: 0;
}
.jeecg-airag-base-node-icon .app-iconify svg {
  stroke: #fff;
  stroke-width: 0;
}
.airag-node-label {
  color: #333;
  font-size: 16px;
  font-weight: 700;
  font-family: æ€æºé»‘ä½“, serif !important;
}

.node-next {
  display: flex;
  justify-content: right;
  align-items: center;
  width: 40px;

  span {
    display: flex;
    align-items: center;
  }
  .next-icon {
    cursor: pointer;
    width: 20px;
    height: 20px;
    background: #fff;
  }
}
</style>